#ifndef __WS_CONSTANT_H__
#define __WS_CONSTANT_H__


#define WS_VERSION          "1.0.0"
#define WS_DEVICE_ID        1          
#define AP_IP_ADDRESS       "192.168.88.1"

//功能模块
enum WsModuleId {
    MODULE_NONE,
    MODULE_CAMERA_TELE,
    MODULE_CAMERA_WIDE,
    MODULE_ASTRO,
    MODULE_SYSTEM,
    MODULE_RGB_POWER,
    MODULE_MOTOR,
    MODULE_TRACK,
    MODULE_FOCUS,
    MODULE_NOTIFY,
    MODULE_PANORAMA,
    MODULE_ITIPS,
};

//websocket消息类型
enum WsCmdType {
    CMD_TYPE_REQUEST,
    CMD_TYPE_ACK,
    CMD_TYPE_NOTIFICATION,
    CMD_TYPE_RESPONSE,
};

//websocket通用错误码
enum WsErrorCode {
    WS_OK,
    WS_PARSE_PROTOBUF_ERROR,
    WS_SDCARD_NOT_EXIST,
    WS_INVAID_PARAM,
    WS_SDCARD_WRITE_ERROR,
};

//长焦相机功能
enum CmdCameraTele {
    CMD_CAMERA_TELE_OPEN_CAMERA = 10000,
    CMD_CAMERA_TELE_CLOSE_CAMERA,
    CMD_CAMERA_TELE_PHOTOGRAPH,
    CMD_CAMERA_TELE_BURST,
    CMD_CAMERA_TELE_STOP_BURST,
    CMD_CAMERA_TELE_START_RECORD,
    CMD_CAMERA_TELE_STOP_RECORD,
    CMD_CAMERA_TELE_SET_EXP_MODE,
    CMD_CAMERA_TELE_GET_EXP_MODE,
    CMD_CAMERA_TELE_SET_EXP,
    CMD_CAMERA_TELE_GET_EXP,
    CMD_CAMERA_TELE_SET_GAIN_MODE,
    CMD_CAMERA_TELE_GET_GAIN_MODE,
    CMD_CAMERA_TELE_SET_GAIN,
    CMD_CAMERA_TELE_GET_GAIN,
    CMD_CAMERA_TELE_SET_BRIGHTNESS,
    CMD_CAMERA_TELE_GET_BRIGHTNESS,
    CMD_CAMERA_TELE_SET_CONTRAST,
    CMD_CAMERA_TELE_GET_CONTRAST,
    CMD_CAMERA_TELE_SET_SATURATION,
    CMD_CAMERA_TELE_GET_SATURATION,
    CMD_CAMERA_TELE_SET_HUE,
    CMD_CAMERA_TELE_GET_HUE,
    CMD_CAMERA_TELE_SET_SHARPNESS,
    CMD_CAMERA_TELE_GET_SHARPNESS,
    CMD_CAMERA_TELE_SET_WB_MODE,
    CMD_CAMERA_TELE_GET_WB_MODE,
    CMD_CAMERA_TELE_SET_WB_SCENE,
    CMD_CAMERA_TELE_GET_WB_SCENE,
    CMD_CAMERA_TELE_SET_WB_CT,
    CMD_CAMERA_TELE_GET_WB_CT,
    CMD_CAMERA_TELE_SET_IRCUT,
    CMD_CAMERA_TELE_GET_IRCUT,
    CMD_CAMERA_TELE_START_TIMELAPSE_PHOTO,
    CMD_CAMERA_TELE_STOP_TIMELAPSE_PHOTO,
    CMD_CAMERA_TELE_SET_ALL_PARAMS,
    CMD_CAMERA_TELE_GET_ALL_PARAMS,
    CMD_CAMERA_TELE_SET_FEATURE_PARAM,
    CMD_CAMERA_TELE_GET_ALL_FEATURE_PARAMS,
    CMD_CAMERA_TELE_GET_SYSTEM_WORKING_STATE,
    CMD_CAMERA_TELE_SET_JPG_QUALITY,
};


//长焦相机错误码
enum CodeCameraTele {
    CODE_CAMERA_TELE_OPENED = 10500,
    CODE_CAMERA_TELE_CLOSED,
    CODE_CAMERA_TELE_ISP_SET_FAILED,
    CODE_CAMERA_TELE_OPEN_FAILED,
    CODE_CAMERA_TELE_START_RECORD_FAILED,
    CODE_CAMERA_TELE_STOP_RECORD_FAILED,
    CODE_CAMERA_TELE_CAPTURE_RAW_FAILED,
    CODE_CAMERA_TELE_WORKING_BUSY,
    CODE_CAMERA_TELE_GET_IMAGE_FAILED,
    CODE_CAMERA_TELE_RUNNING_PHOTO,
    CODE_CAMERA_TELE_RUNNING_RECORD,
    CODE_CAMERA_TELE_RUNNING_PANORAMA,
    CODE_CAMERA_TELE_RUNNING_TIMELAPSE,
    CODE_CAMERA_TELE_RUNNING_CAPTURE_DARK,
    CODE_CAMERA_TELE_RUNNING_CAPTURE_LIVE_STACKING,
};

//天文功能
enum CmdAstro {
    CMD_ASTRO_START_CALIBRATION = 11000,
    CMD_ASTRO_STOP_CALIBRATION,
    CMD_ASTRO_START_GOTO_DSO,
    CMD_ASTRO_START_GOTO_SOLAR_SYSTEM,
    CMD_ASTRO_STOP_GOTO,
    CMD_ASTRO_START_CAPTURE_RAW_LIVE_STACKING,
    CMD_ASTRO_STOP_CAPTURE_RAW_LIVE_STACKING,
    CMD_ASTRO_START_CAPTURE_RAW_DARK,
    CMD_ASTRO_STOP_CAPTURE_RAW_DARK,
    CMD_ASTRO_CHECK_GOT_DARK,
    CMD_ASTRO_GO_LIVE,
    CMD_ASTRO_START_TRACK_SPECIAL_TARGET,
    CMD_ASTRO_STOP_TRACK_SPECIAL_TARGET,
    CMD_ASTRO_START_ONE_CLICK_GOTO,
};

//天文功能错误码
enum CodeAstro {
    CODE_ASTRO_PLATE_SOLVING_FAILED = 11500,
    CODE_ASTRO_FUNCTION_BUSY,
    CODE_ASTRO_DARK_GAIN_OUT_OF_RANGE,
    CODE_ASTRO_DARK_NOT_FOUND,
    CODE_ASTRO_CALIBRATION_FAILED,
    CODE_ASTRO_GOTO_FAILED,
    CODE_ASTRO_DARK_RUNNING,
    CODE_ASTRO_CALIBRATION_RUNNING,
    CODE_ASTRO_GOTO_RUNNING,
    CODE_ASTRO_LIVE_STACKING_RUNNING,
    CODE_ASTRO_RESET_PITCH_MOTOR_FAILED,
    CODE_ASTRO_NEED_CALIBRATION,
    CODE_ASTRO_GOTO_READ_MOTOR_POSITION_AND_PLATE_SOLVING_FAILED,
    CODE_ASTRO_NEED_GOTO,
    CODE_ASTRO_NEED_ADJUST_SHOOT_PARAM,
    CODE_ASTRO_CALIBRATION_PLATE_SOLVING_FAILED_TOO_MUCH,
};

//广角摄像头功能
enum CmdCamUvc {
    CMD_CAMERA_WIDE_OPEN_CAMERA = 12000,
    CMD_CAMERA_WIDE_CLOSE_CAMERA,
    CMD_CAMERA_WIDE_SET_EXP_MODE,
    CMD_CAMERA_WIDE_GET_EXP_MODE,
    CMD_CAMERA_WIDE_SET_EXP,
    CMD_CAMERA_WIDE_GET_EXP,
    CMD_CAMERA_WIDE_SET_GAIN,
    CMD_CAMERA_WIDE_GET_GAIN,
    CMD_CAMERA_WIDE_SET_BRIGHTNESS,
    CMD_CAMERA_WIDE_GET_BRIGHTNESS,
    CMD_CAMERA_WIDE_SET_CONTRAST,
    CMD_CAMERA_WIDE_GET_CONTRAST,
    CMD_CAMERA_WIDE_SET_SATURATION,
    CMD_CAMERA_WIDE_GET_SATURATION,
    CMD_CAMERA_WIDE_SET_HUE,
    CMD_CAMERA_WIDE_GET_HUE,
    CMD_CAMERA_WIDE_SET_SHARPNESS,
    CMD_CAMERA_WIDE_GET_SHARPNESS,
    CMD_CAMERA_WIDE_SET_WB_MODE,
    CMD_CAMERA_WIDE_GET_WB_MODE,
    CMD_CAMERA_WIDE_SET_WB_CT,
    CMD_CAMERA_WIDE_GET_WB_CT,
    CMD_CAMERA_WIDE_PHOTOGRAPH,
    CMD_CAMERA_WIDE_BURST,
    CMD_CAMERA_WIDE_STOP_BURST,
    CMD_CAMERA_WIDE_START_TIMELAPSE_PHOTO,
    CMD_CAMERA_WIDE_STOP_TIMELAPSE_PHOTO,
    CMD_CAMERA_WIDE_GET_ALL_PARAMS,
    CMD_CAMERA_WIDE_SET_ALL_PARAMS,
    
};

//广角摄像头错误码
enum CodeCamUvc {
    CODE_CAMERA_WIDE_OPENED = 12500,
    CODE_CAMERA_WIDE_CLOSED,
    CODE_CAMERA_WIDE_CANNOT_FOUND,
    CODE_CAMERA_WIDE_OPEN_FAILED,
    CODE_CAMERA_WIDE_CLOSE_FAILED,
    CODE_CAMERA_WIDE_SET_ISP_FAILED,
    CODE_CAMERA_WIDE_PHOTOGRAPHING,
    CODE_CAMERA_WIDE_TIMELAPSE_RECORDING,
};

//系统功能
enum CmdSystem {
    CMD_SYSTEM_SET_TIME = 13000,
    CMD_SYSTEM_SET_TIME_ZONE,
    CMD_SYSTEM_SET_MTP_MODE,
    CMD_SYSTEM_SET_CPU_MODE,
    CMD_SYSTEM_SET_MASTER,
};

//系统功能错误码
enum CodeSystem {
    CODE_SYSTEM_SET_TIME_FAILED = 13300,
    CODE_SYSTEM_SET_TIMEZONE_FAILED,
};

//RGB&电源管理功能
enum CmdRgbPower {
    CMD_RGB_POWER_OPEN_RGB = 13500,
    CMD_RGB_POWER_CLOSE_RGB,
    CMD_RGB_POWER_POWER_DOWN,
    CMD_RGB_POWER_POWERIND_ON,
    CMD_RGB_POWER_POWERIND_OFF,
    CMD_RGB_POWER_REBOOT,
};

enum CodeRgbPower {
    CODE_RGB_POWER_UART_INIT_FAILED = 13800,
    CODE_RGB_POWER_UART_SEND_FAILED,
};

//电机功能 
enum CmdStepMotor {
    CMD_STEP_MOTOR_RUN = 14000,
    CMD_STEP_MOTOR_RUN_TO,
    CMD_STEP_MOTOR_STOP,
    CMD_STEP_MOTOR_RESET,
    CMD_STEP_MOTOR_CHANGE_SPEED,
    CMD_STEP_MOTOR_CHANGE_DIRECTION,
    CMD_STEP_MOTOR_SERVICE_JOYSTICK,
    CMD_STEP_MOTOR_SERVICE_JOYSTICK_FIXED_ANGLE,
    CMD_STEP_MOTOR_SERVICE_JOYSTICK_STOP,
    CMD_STEP_MOTOR_SERVICE_DUAL_CAMERA_LINKAGE,
};

//电机错误码
enum CodeStepMotor {
    CODE_STEP_MOTOR_IS_RUNNING = 14500,
    CODE_STEP_MOTOR_IS_STOPPED,
    CODE_STEP_MOTOR_PARALLEL_IN,
    CODE_STEP_MOTOR_PARALLEL_END,
    CODE_STEP_MOTOR_INVALID_PARAMETER_ID,
    CODE_STEP_MOTOR_INVALID_PARAMETER_ANGLE,
    CODE_STEP_MOTOR_INVALID_PARAMETER_SPEED,
    CODE_STEP_MOTOR_INVALID_PARAMETER_SPEED_RAMPING,
    CODE_STEP_MOTOR_INVALID_PARAMETER_RESOLUTION,
    CODE_STEP_MOTOR_INVALID_PARAMETER_POSITION,
    CODE_STEP_MOTOR_OVERTIME_GET_LIMIT_RETURN,
    CODE_STEP_MOTOR_OVERTIME_GET_RESET_RETURN,
    CODE_STEP_MOTOR_OVERTIME_GET_ABSOLUTE_POSITION_RETURN,
    CODE_STEP_MOTOR_OVERTIME_GET_RELATIVE_POSITION_RETURN,
    CODE_STEP_MOTOR_OVERTIME_WAIT_TO_STOP,
    CODE_STEP_MOTOR_OVERTIME_WAIT_TO_RUN,
    CODE_STEP_MOTOR_LIMIT_SPEED_TO_MAX,
    CODE_STEP_MOTOR_LIMIT_SPEED_TO_MIN,
    CODE_STEP_MOTOR_LIMIT_POSITION_WARNING,
    CODE_STEP_MOTOR_LIMIT_POSITION_HITTED,
    CODE_STEP_MOTOR_NEED_RESET
};

// 跟踪功能
enum CmdTrack {
    CMD_TRACK_START_TRACK = 14800,
    CMD_TRACK_STOP_TRACK,
    CMD_SENTRY_MODE_START,
    CMD_SENTRY_MODE_STOP,
};

enum CodeTrack {
    CODE_TRACK_TRACKER_INITING = 14900,
    CODE_TRACK_TRACKER_FAILED,
    CODE_TRACK_SENTRY_MODE_INITING,
    CODE_TRACK_SENTRY_MODE_FAILED,
};

// 对焦功能
enum CmdFocus {
    CMD_FOCUS_AUTO_FOCUS = 15000,
    CMD_FOCUS_MANUAL_SINGLE_STEP_FOCUS,
    CMD_FOCUS_START_MANUAL_CONTINU_FOCUS,
    CMD_FOCUS_STOP_MANUAL_CONTINU_FOCUS,
    CMD_FOCUS_START_ASTRO_AUTO_FOCUS,
    CMD_FOCUS_STOP_ASTRO_AUTO_FOCUS,
};


enum CodeFocus {
    CODE_FOCUS_ASTRO_AUTO_FOCUS_SLOW_ERROR = 15100,
    CODE_FOCUS_ASTRO_AUTO_FOCUS_FAST_ERROR,
    CODE_FOCUS_ASTRO_STAR_CLOSE_TO_BORDER,
    CODE_FOCUS_ASTRO_DATA_NOT_ENOUGH,
    CODE_FOCUS_ASTRO_DATA_ERROR,
    CODE_FOCUS_BUSY,
};

// 通知功能
enum CmdNotify {
    CMD_NOTIFY_TELE_WIDI_PICTURE_MATCHING = 15200,
    CMD_NOTIFY_ELE,
    CMD_NOTIFY_CHARGE,
    CMD_NOTIFY_SDCARD_INFO,
    CMD_NOTIFY_TELE_RECORD_TIME,
    CMD_NOTIFY_TELE_TIMELAPSE_OUT_TIME,
    CMD_NOTIFY_STATE_CAPTURE_RAW_DARK,
    CMD_NOTIFY_PROGRASS_CAPTURE_RAW_DARK,
    CMD_NOTIFY_STATE_CAPTURE_RAW_LIVE_STACKING,
    CMD_NOTIFY_PROGRASS_CAPTURE_RAW_LIVE_STACKING,
    CMD_NOTIFY_STATE_ASTRO_CALIBRATION,
    CMD_NOTIFY_STATE_ASTRO_GOTO,
    CMD_NOTIFY_STATE_ASTRO_TRACKING,
    CMD_NOTIFY_TELE_SET_PARAM,
    CMD_NOTIFY_WIDE_SET_PARAM,
    CMD_NOTIFY_TELE_FUNCTION_STATE,
    CMD_NOTIFY_WIDE_FUNCTION_STATE,
    CMD_NOTIFY_SET_FEATURE_PARAM,
    CMD_NOTIFY_TELE_BURST_PROGRESS,
    CMD_NOTIFY_PANORAMA_PROGRESS,
    CMD_NOTIFY_WIDE_BURST_PROGRESS,
    CMD_NOTIFY_RGB_STATE,
    CMD_NOTIFY_POWER_IND_STATE,
    CMD_NOTIFY_WS_HOST_SLAVE_MODE,
    CMD_NOTIFY_MTP_STATE,
    CMD_NOTIFY_TRACK_RESULT,
    CMD_NOTIFY_WIDE_TIMELAPSE_OUT_TIME,
    CMD_NOTIFY_CPU_MODE,
    CMD_NOTIFY_STATE_ASTRO_TRACKING_SPECIAL,
    CMD_NOTIFY_POWER_OFF,
    CMD_NOTIFY_ALBUM_UPDATE,
    CMD_NOTIFY_SENTRY_MODE_STATE,
    CMD_NOTIFY_SENTRY_MODE_TRACK_RESULT,
};

enum StateNotify {
    STATE_IDLE = 0,
    STATE_RUNNING,
    STATE_STOPPING,
    STATE_STOPPED,
    STATE_ASTRO_PLATE_SOLVING,
};

// 哨兵模式
enum StateSentryModeNotify {
    STATE_SENTRY_MODE_IDLE = 0,
    STATE_SENTRY_MODE_INIT,
    STATE_SENTRY_MODE_DETECT,
    STATE_SENTRY_MODE_TRACK,
    STATE_SENTRY_MODE_TRACK_FINISH,
    STATE_SENTRY_MODE_STOPPING,
};

//全景功能
enum CmdPanorama{
    CMD_PANORAMA_START_GRID = 15500,
    CMD_PANORAMA_STOP,
    CMD_PANORAMA_START_EULER,
};

enum CodePanorama {
    CODE_PANORAMA_PHOTO_FAILED = 15600,
    CODE_PANORAMA_MOTOR_RESET_FAILED,
};

enum CamFunctionId {
    CAM_FUNCTION_OPEN_CLOSE = 1,
    CAM_FUNCTION_PHOTO,
    CAM_FUNCTION_BURST,
    CAM_FUNCTION_RECORD,
    CAM_FUNCTION_TIMELAPSE,
    CAM_FUNCTION_PANORAMA,
    CAM_FUNCTION_TRACK,
    CAM_FUNCTION_ASTRO_AUTO_FOCUS,
    CAM_FUNCTION_NORMAL_AUTO_FOCUS,
    CAM_FUNCTION_ASTRO_AUTO_FOCUS_FAST,
    CAM_FUNCTION_AREA_AUTO_FOCUS,
};

// 智能提示功能
enum CmdITips {
    CMD_ITIPS_GET = 15700,
};

// 指引码
enum CodeITipsGuide {
    CODE_ITIPS_GUIDE_CAPTURE_DARK = 500,
    CODE_ITIPS_GUIDE_FAST_FOCUS_SUN_MOON,
    CODE_ITIPS_GUIDE_SLOW_FOCUS_SUN_MOON,
    CODE_ITIPS_GUIDE_FAST_FOCUS_STAR,
    CODE_ITIPS_GUIDE_SLOW_FOCUS_STAR,
    CODE_ITIPS_GUIDE_CALIBRATION,
    CODE_ITIPS_GUIDE_GOTO_SUN_MOON,
    CODE_ITIPS_GUIDE_GOTO_STAR,
    CODE_ITIPS_GUIDE_NO_SUN_MOON,
    CODE_ITIPS_GUIDE_NO_STAR,
    CODE_ITIPS_GUIDE_ADJUST_SHOOT_PARAM,
    CODE_ITIPS_GUIDE_LIVE_STACKING,
    CODE_ITIPS_GUIDE_GO_LIVE,
    CODE_ITIPS_GUIDE_SUCCESS,
};

#endif